package com.yeren.tarena.practice.ff;

public class sortDemo {
	public static void main(String[] args) {
		int[] b = { 89, 50, 84, 57, 61, 20, 86 };
		System.out.println("aa");
		sortqq(b);
	}

	// 排序算法
	public static void sortqq(int[] a) {
		// 遍历数组
		for (int i = 0; i < a.length - 1; i++) {
			for (int j = 0; j < a.length - 1; j++) {
				int temp = 0;// 假设a[0]最小
				if (a[j] > a[j + 1]) {
					temp = a[j + 1];
					a[j + 1] = a[j];
					a[j] = temp;
				}
			}
		}

		// 打印数组
		for (int i = 0; i < a.length; i++) {
			System.out.print(a[i] + " ");
		}
	}
}
